#include "transport_layer.h"
#include "server_session_layer.h"
#include "server_transport_layer.h"

/* process input and answer calculation to the client */
void 
doServer(void)
{
	int recvDataSize, responseDataSize;
	char response[BUFFER_SIZE];
	char receivedData[BUFFER_SIZE];

	while(1)
	{
		if ((recvDataSize = recvData(receivedData)) < 0)
			continue;
		/* ignore if too big */
		if(recvDataSize < BUFFER_SIZE)
		{
			responseDataSize = getResponse(response, receivedData);
			sendData(response, responseDataSize);
		}
	}

}
